import { useAxios } from '@/hooks/web/useAxios'
import { RealDataVO,RealDataPageReqVO,RealDataExcelReqVO } from './types'

const request = useAxios()

// 查询实时数据列表
export const getRealDataPageApi = async (params: RealDataPageReqVO) => {
    return await request.get({ url: '/water/real-data/page', params })
}

// 查询实时数据详情
export const getRealDataApi = async (id: number) => {
    return await request.get({ url: '/water/real-data/get?id=' + id })
}

// 新增实时数据
export const createRealDataApi = async (data: RealDataVO) => {
    return await request.post({ url: '/water/real-data/create', data })
}

// 修改实时数据
export const updateRealDataApi = async (data: RealDataVO) => {
    return await request.put({ url: '/water/real-data/update', data })
}

// 删除实时数据
export const deleteRealDataApi = async (id: number) => {
    return await request.delete({ url: '/water/real-data/delete?id=' + id })
}

// 导出实时数据 Excel
export const exportRealDataApi = async (params: RealDataExcelReqVO) => {
    return await request.download({ url: '/water/real-data/export-excel', params })
}
